/**
 * Created by admin on 2017/9/30.
 */
define([
    "helpers/network"
], function (Network) {

    var data = [];
    function fetchData(callback) {
        var obj = {
            params: {
                type: "Role"
            },
            sort: ["creationTime,desc"],
            all: true
        };
        Network.ajax("/BizView.queryAll.query", obj, function (ret) {
            var aaa = [];
            _.forEach(ret.data.content, function (each) {
                aaa.push(each.data)
            });
            this.data = aaa;
            if (callback) {
                callback(ret)
            }
        }.bind(this));
    }

    return {
        fetchData: fetchData,
        data: data,
    };

});